<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let num1 = parseFloat(prompt("请输入第一个数："));
    let num2 = parseFloat(prompt("请输入第二个数："));

    // function getMax(x = 0, y = 0) {
    //   let max = x > y ? x : y;
    //   return max
    // }

    function getMax(x = 0, y = 0) {
      return x > y ? x : y;
    }
    let max = getMax(num1, num2);
    // alert("两个数中最大值是：" + getMax(num1, num2));
    alert("两个数中最大值是：" + max);
  </script>
</body>

</html>